var tel1 = document.querySelector('.userp1')
var tel2 = document.querySelector('.userp2')
var tel3 = document.querySelector('.userp3')
var tel4 = document.querySelector('.userp4')
var tel5 = document.querySelector('.userp5')
var tel6 = document.querySelector('.userp6')
var des1 = document.querySelector('.p1')
var des2 = document.querySelector('.p2')
var des3 = document.querySelector('.p3')
var des4 = document.querySelector('.p4')
var des5 = document.querySelector('.p5')
var des6 = document.querySelector('.p6')
var telReg1 = /^1[3-9][0-9]{9}$/
var telReg2 = /^[a-z0-9_-]{6,16}$/
var telReg3 = /^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/
tel1.onfocus = function(){
    des1.innerHTML = '请输入手机号'
    // des.className = 'cl1'
}
tel1.onblur = function(){
    if(telReg1.test(tel1.value)){
        des1.innerHTML = '√'
        des1.className = 'cl3'
    }else{
        des1.innerHTML = '手机号格式错误'
        // des.className = 'cl2'
    }
}
tel2.onfocus = function(){
    des2.innerHTML = '请输入密码'
    // des.className = 'cl1'
}
tel2.onblur = function(){
    if(telReg2.test(tel2.value)){
        des2.innerHTML = '√'
        des2.className = 'cl3'
    }else{
        des2.innerHTML = '密码格式错误'
        // des.className = 'cl2'
    }
}
tel3.onfocus = function(){
    des3.innerHTML = '请输入手机号'
    // des.className = 'cl1'
}
tel3.onblur = function(){
    if(telReg1.test(tel3.value)){
        des3.innerHTML = '√'
        des3.className = 'cl3'
    }else{
        des3.innerHTML = '手机号格式错误'
        // des.className = 'cl2'
    }
}
tel4.onfocus = function(){
    des4.innerHTML = '请输入邮箱号'
    // des.className = 'cl1'
}
tel4.onblur = function(){
    if(telReg3.test(tel4.value)){
        des4.innerHTML = '√'
        des4.className = 'cl3'
    }else{
        des4.innerHTML = '邮箱号格式错误'
        // des.className = 'cl2'
    }
}
tel5.onfocus = function(){
    des5.innerHTML = '请输入密码'
    // des.className = 'cl1'
}
tel5.onblur = function(){
    if(telReg2.test(tel5.value)){
        des5.innerHTML = '√'
        des5.className = 'cl3'
    }else{
        des5.innerHTML = '密码格式错误'
        // des.className = 'cl2'
    }
}
